package com.study.english.service.impl;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.study.english.pojo.vo.PlStudyPlanVideoTypeVo;
import org.springframework.beans.factory.annotation.Autowired;

import java.util.Date;
import java.util.List;

import org.springframework.beans.BeanUtils;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.study.english.domain.PlStudyPlanVideoType;
import com.study.english.service.IPlStudyPlanVideoTypeService;
import com.study.english.mapper.PlStudyPlanVideoTypeMapper;
import org.springframework.stereotype.Service;

/**
 * @author wf
 * @description 针对表【pl_study_plan_video_type(学习计划视频类型)】的数据库操作Service实现
 * @createDate 2024-06-27 15:28:53
 */
@Service
public class PlStudyPlanVideoTypeServiceImpl extends ServiceImpl<PlStudyPlanVideoTypeMapper, PlStudyPlanVideoType>
        implements IPlStudyPlanVideoTypeService {

    @Autowired
    private IPlStudyPlanVideoTypeService plStudyPlanVideoTypeService;


    @Override
    public void addPlStudyPlanVideoType(PlStudyPlanVideoTypeVo plStudyPlanVideoTypeVo) {
        PlStudyPlanVideoType plStudyPlanVideoType = new PlStudyPlanVideoType();
        BeanUtils.copyProperties(plStudyPlanVideoTypeVo, plStudyPlanVideoType);
        plStudyPlanVideoType.setIsDelete(0);
        plStudyPlanVideoType.setCreateTime(new Date());
        plStudyPlanVideoTypeService.save(plStudyPlanVideoType);
    }

    @Override
    public IPage<PlStudyPlanVideoTypeVo> getPlStudyPlanVideoTypePageList(IPage<PlStudyPlanVideoTypeVo> page, PlStudyPlanVideoTypeVo plStudyPlanVideoTypeVo) {
        return this.baseMapper.getPlStudyPlanVideoTypePageList(page, plStudyPlanVideoTypeVo);
    }


    @Override
    public List<PlStudyPlanVideoTypeVo> getPlStudyPlanVideoTypeList(PlStudyPlanVideoTypeVo plStudyPlanVideoTypeVo) {
        return this.baseMapper.getPlStudyPlanVideoTypeList(plStudyPlanVideoTypeVo);

    }

    @Override
    public PlStudyPlanVideoTypeVo getPlStudyPlanVideoTypeById(Long id) {
        return this.baseMapper.getDetailById(id);
    }


    @Override
    public void delPlStudyPlanVideoType(Long id) {
        plStudyPlanVideoTypeService.removeById(id);
    }


    @Override
    public void updatePlStudyPlanVideoType(PlStudyPlanVideoTypeVo plStudyPlanVideoTypeVo) {
        PlStudyPlanVideoType plStudyPlanVideoType = new PlStudyPlanVideoType();
        BeanUtils.copyProperties(plStudyPlanVideoTypeVo, plStudyPlanVideoType);
        plStudyPlanVideoTypeService.updateById(plStudyPlanVideoType);
    }
}




